package Sudoku3.rules;
import Sudoku3.structure.bucket;
import Sudoku3.structure.cell;


public class rule03_neighboring_value {
	
	public rule03_neighboring_value(cell c) {
		//get a bucket of this cell's neighbors
		bucket b = c.getAllNeighbors();
		//iterate values
		for (int i = 1; i < 10; i++) {
			//iterate cells in the bucket of neighbors
			for (cell x : b) {
				//if the current cell has value i, and the original cell has i as a possibility, remove it.
				if ((x.getValue() == i) && (c.isPossible(i)) ) {
					c.removePossible(i);
//					System.out.println("Rule 03:  Neighboring Value(" + i + ") found in cell (" + x.toStringCoords() + ").  Removing possiblity from cell (" + c.toStringCoords() + ").");
					continue;
				}
			}
		}
	}
}
